<?php

/**
 * This is the model class for table "luastanamperkecamatan".
 *
 * The followings are the available columns in table 'luastanamperkecamatan':
 * @property integer $ltpc_id
 * @property integer $ltpc_kec
 * @property integer $lptc_bm_tanam
 * @property integer $lptc_bm_panen
 * @property integer $lptc_bm_produksi
 * @property integer $lptc_bp_tanam
 * @property integer $lptc_bp_panen
 * @property integer $lptc_bp_produksi
 * @property integer $lptc_bd_tanam
 * @property integer $lptc_bd_panen
 * @property integer $lptc_bd_produksi
 * @property integer $lptc_kentang_tanam
 * @property integer $lptc_kentang_panen
 * @property integer $lptc_kentang_produksi
 * @property integer $lptc_kol_tanam
 * @property integer $lptc_kol_panen
 * @property integer $lptc_kol_produksi
 * @property integer $lptc_sawi_tanam
 * @property integer $lptc_sawi_panen
 * @property integer $lptc_sawi_produksi
 * @property integer $lptc_cabemerah_tanam
 * @property integer $lptc_cabemerah_panen
 * @property integer $lptc_cabemerah_produksi
 * @property integer $lptc_caberawit_tanam
 * @property integer $lptc_caberawit_panen
 * @property integer $lptc_caberawit_produksi
 * @property integer $lptc_tomat_tanam
 * @property integer $lptc_tomat_panen
 * @property integer $lptc_tomat_produksi
 * @property integer $lptc_terung_tanam
 * @property integer $lptc_terung_panen
 * @property integer $lptc_terung_produksi
 * @property integer $lptc_buncis_tanam
 * @property integer $lptc_buncis_panen
 * @property integer $lptc_buncis_produksi
 * @property integer $lptc_timun_tanam
 * @property integer $lptc_timun_panen
 * @property integer $lptc_timun_produksi
 * @property integer $lptc_kangkung_tanam
 * @property integer $lptc_kangkung_panen
 * @property integer $lptc_kangkung_produksi
 * @property integer $lptc_bayam_tanam
 * @property integer $lptc_bayam_panen
 * @property integer $lptc_bayam_produksi
 * @property integer $lptc_kacangmerah_tanam
 * @property integer $lptc_kacangmerah_panen
 * @property integer $lptc_kacangmerah_produksi
 * @property integer $lptc_kacangpanjang_tanam
 * @property integer $lptc_kacangpanjang_panen
 * @property integer $lptc_kajangpanjang_produksi
 * @property integer $lptc_labu_tanam
 * @property integer $lptc_labu_panen
 * @property integer $lptc_labu_produksi
 * @property integer $lptc_lobak_tanam
 * @property integer $lptc_lobak_panen
 * @property integer $lptc_lobak_produksi
 * @property integer $tahun
 *
 * The followings are the available model relations:
 * @property Kecamatan $ltpcKec
 */
class Luastanamperkecamatan extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return Luastanamperkecamatan the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'luastanamperkecamatan';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('ltpc_kec, lptc_bm_tanam, lptc_bm_panen, lptc_bm_produksi, lptc_bp_tanam, lptc_bp_panen, lptc_bp_produksi, lptc_bd_tanam, lptc_bd_panen, lptc_bd_produksi, lptc_kentang_tanam, lptc_kentang_panen, lptc_kentang_produksi, lptc_kol_tanam, lptc_kol_panen, lptc_kol_produksi, lptc_sawi_tanam, lptc_sawi_panen, lptc_sawi_produksi, lptc_cabemerah_tanam, lptc_cabemerah_panen, lptc_cabemerah_produksi, lptc_caberawit_tanam, lptc_caberawit_panen, lptc_caberawit_produksi, lptc_tomat_tanam, lptc_tomat_panen, lptc_tomat_produksi, lptc_terung_tanam, lptc_terung_panen, lptc_terung_produksi, lptc_buncis_tanam, lptc_buncis_panen, lptc_buncis_produksi, lptc_timun_tanam, lptc_timun_panen, lptc_timun_produksi, lptc_kangkung_tanam, lptc_kangkung_panen, lptc_kangkung_produksi, lptc_bayam_tanam, lptc_bayam_panen, lptc_bayam_produksi, lptc_kacangmerah_tanam, lptc_kacangmerah_panen, lptc_kacangmerah_produksi, lptc_kacangpanjang_tanam, lptc_kacangpanjang_panen, lptc_kajangpanjang_produksi, lptc_labu_tanam, lptc_labu_panen, lptc_labu_produksi, lptc_lobak_tanam, lptc_lobak_panen, lptc_lobak_produksi, tahun', 'numerical', 'integerOnly'=>true),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('ltpc_id, ltpc_kec, lptc_bm_tanam, lptc_bm_panen, lptc_bm_produksi, lptc_bp_tanam, lptc_bp_panen, lptc_bp_produksi, lptc_bd_tanam, lptc_bd_panen, lptc_bd_produksi, lptc_kentang_tanam, lptc_kentang_panen, lptc_kentang_produksi, lptc_kol_tanam, lptc_kol_panen, lptc_kol_produksi, lptc_sawi_tanam, lptc_sawi_panen, lptc_sawi_produksi, lptc_cabemerah_tanam, lptc_cabemerah_panen, lptc_cabemerah_produksi, lptc_caberawit_tanam, lptc_caberawit_panen, lptc_caberawit_produksi, lptc_tomat_tanam, lptc_tomat_panen, lptc_tomat_produksi, lptc_terung_tanam, lptc_terung_panen, lptc_terung_produksi, lptc_buncis_tanam, lptc_buncis_panen, lptc_buncis_produksi, lptc_timun_tanam, lptc_timun_panen, lptc_timun_produksi, lptc_kangkung_tanam, lptc_kangkung_panen, lptc_kangkung_produksi, lptc_bayam_tanam, lptc_bayam_panen, lptc_bayam_produksi, lptc_kacangmerah_tanam, lptc_kacangmerah_panen, lptc_kacangmerah_produksi, lptc_kacangpanjang_tanam, lptc_kacangpanjang_panen, lptc_kajangpanjang_produksi, lptc_labu_tanam, lptc_labu_panen, lptc_labu_produksi, lptc_lobak_tanam, lptc_lobak_panen, lptc_lobak_produksi, tahun', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
			'ltpcKec' => array(self::BELONGS_TO, 'Kecamatan', 'ltpc_kec'),
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'ltpc_id' => 'Ltpc',
			'ltpc_kec' => 'Ltpc Kec',
			'lptc_bm_tanam' => 'Luas Tanam Bawang Merah(Ha)',
			'lptc_bm_panen' => 'Luas Panen Bawang Merah(Ha)',
			'lptc_bm_produksi' => 'Produksi Bawang Merah(Ton)',
			'lptc_bp_tanam' => 'Luas Tanam Bawang Putih(Ha)',
			'lptc_bp_panen' => 'Luas Panen Bawang Putih(Ha)',
			'lptc_bp_produksi' => 'Produksi Bawang Putih(Ton)',
			'lptc_bd_tanam' => 'Luas Tanam Bawang Daun(Ha)',
			'lptc_bd_panen' => 'Luas Panen Bawang Daun(Ha)',
			'lptc_bd_produksi' => 'Produksi Bawang Daun(Ton)',
			'lptc_kentang_tanam' => 'Luas Tanam Kentang(Ha)',
			'lptc_kentang_panen' => 'Luas Panen Kentang(Ha)',
			'lptc_kentang_produksi' => 'Produksi Kentang(Ton)',
			'lptc_kol_tanam' => 'Luas Tanam Kol(Ha)',
			'lptc_kol_panen' => 'Luas Panen Kol(Ha)',
			'lptc_kol_produksi' => 'Produksi Kol(Ton)',
			'lptc_sawi_tanam' => 'Luas Tanam Sawi(Ha)',
			'lptc_sawi_panen' => 'Luas Panen Sawi(Ha)',
			'lptc_sawi_produksi' => 'Produksi Sawi(Ton)',
			'lptc_cabemerah_tanam' => 'Luas Tanam Cabe Merah(Ha)',
			'lptc_cabemerah_panen' => 'Luas Panen Cabe Merah(Ha)',
			'lptc_cabemerah_produksi' => 'Produksi Cabe Merah(Ton)',
			'lptc_caberawit_tanam' => 'Luas Tanam Cabe Rawit(Ha)',
			'lptc_caberawit_panen' => 'Luas Panen Cabe Rawit(Ha)',
			'lptc_caberawit_produksi' => 'Produksi Cabe Rawit(Ton)',
			'lptc_tomat_tanam' => 'Luas Tanam Tomat(Ha)',
			'lptc_tomat_panen' => 'Luas Panen Tomat(Ha)',
			'lptc_tomat_produksi' => 'Produksi Tomat',
			'lptc_terung_tanam' => 'Luas Tanam Terung',
			'lptc_terung_panen' => 'Luas Panen Terung',
			'lptc_terung_produksi' => 'Produksi Terung',
			'lptc_buncis_tanam' => 'Luas Tanam Buncis',
			'lptc_buncis_panen' => 'Luas Panen Buncis',
			'lptc_buncis_produksi' => 'Produksi Buncis',
			'lptc_timun_tanam' => 'Luas Tanam Timun',
			'lptc_timun_panen' => 'Luas Panen Timun',
			'lptc_timun_produksi' => 'Produksi Timun',
			'lptc_kangkung_tanam' => 'Luas Tanam Kangkung',
			'lptc_kangkung_panen' => 'Luas Panen Kangkung',
			'lptc_kangkung_produksi' => 'Produksi Kangkung',
			'lptc_bayam_tanam' => 'Luas Tanam Bayam',
			'lptc_bayam_panen' => 'Luas Panen Bayam',
			'lptc_bayam_produksi' => 'Produksi Bayam',
			'lptc_kacangmerah_tanam' => 'Luas Tanam Kacang Merah',
			'lptc_kacangmerah_panen' => 'Luas Panen Kacang Merah',
			'lptc_kacangmerah_produksi' => 'Produksi Kacang Merah',
			'lptc_kacangpanjang_tanam' => 'Luas Tanam Kacang Panjang',
			'lptc_kacangpanjang_panen' => 'Luas Panen Kacang Panjang',
			'lptc_kajangpanjang_produksi' => 'Produksi Kacang Panjang',
			'lptc_labu_tanam' => 'Luas Tanam Labu',
			'lptc_labu_panen' => 'Luas Panen Labu',
			'lptc_labu_produksi' => 'Produksi Labu',
			'lptc_lobak_tanam' => 'Luas Tanam Lobak',
			'lptc_lobak_panen' => 'Luas Panen Lobak',
			'lptc_lobak_produksi' => 'Produksi Lobak',
			'tahun' => 'Tahun',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('ltpc_id',$this->ltpc_id);
		$criteria->compare('ltpc_kec',$this->ltpc_kec);
		$criteria->compare('lptc_bm_tanam',$this->lptc_bm_tanam);
		$criteria->compare('lptc_bm_panen',$this->lptc_bm_panen);
		$criteria->compare('lptc_bm_produksi',$this->lptc_bm_produksi);
		$criteria->compare('lptc_bp_tanam',$this->lptc_bp_tanam);
		$criteria->compare('lptc_bp_panen',$this->lptc_bp_panen);
		$criteria->compare('lptc_bp_produksi',$this->lptc_bp_produksi);
		$criteria->compare('lptc_bd_tanam',$this->lptc_bd_tanam);
		$criteria->compare('lptc_bd_panen',$this->lptc_bd_panen);
		$criteria->compare('lptc_bd_produksi',$this->lptc_bd_produksi);
		$criteria->compare('lptc_kentang_tanam',$this->lptc_kentang_tanam);
		$criteria->compare('lptc_kentang_panen',$this->lptc_kentang_panen);
		$criteria->compare('lptc_kentang_produksi',$this->lptc_kentang_produksi);
		$criteria->compare('lptc_kol_tanam',$this->lptc_kol_tanam);
		$criteria->compare('lptc_kol_panen',$this->lptc_kol_panen);
		$criteria->compare('lptc_kol_produksi',$this->lptc_kol_produksi);
		$criteria->compare('lptc_sawi_tanam',$this->lptc_sawi_tanam);
		$criteria->compare('lptc_sawi_panen',$this->lptc_sawi_panen);
		$criteria->compare('lptc_sawi_produksi',$this->lptc_sawi_produksi);
		$criteria->compare('lptc_cabemerah_tanam',$this->lptc_cabemerah_tanam);
		$criteria->compare('lptc_cabemerah_panen',$this->lptc_cabemerah_panen);
		$criteria->compare('lptc_cabemerah_produksi',$this->lptc_cabemerah_produksi);
		$criteria->compare('lptc_caberawit_tanam',$this->lptc_caberawit_tanam);
		$criteria->compare('lptc_caberawit_panen',$this->lptc_caberawit_panen);
		$criteria->compare('lptc_caberawit_produksi',$this->lptc_caberawit_produksi);
		$criteria->compare('lptc_tomat_tanam',$this->lptc_tomat_tanam);
		$criteria->compare('lptc_tomat_panen',$this->lptc_tomat_panen);
		$criteria->compare('lptc_tomat_produksi',$this->lptc_tomat_produksi);
		$criteria->compare('lptc_terung_tanam',$this->lptc_terung_tanam);
		$criteria->compare('lptc_terung_panen',$this->lptc_terung_panen);
		$criteria->compare('lptc_terung_produksi',$this->lptc_terung_produksi);
		$criteria->compare('lptc_buncis_tanam',$this->lptc_buncis_tanam);
		$criteria->compare('lptc_buncis_panen',$this->lptc_buncis_panen);
		$criteria->compare('lptc_buncis_produksi',$this->lptc_buncis_produksi);
		$criteria->compare('lptc_timun_tanam',$this->lptc_timun_tanam);
		$criteria->compare('lptc_timun_panen',$this->lptc_timun_panen);
		$criteria->compare('lptc_timun_produksi',$this->lptc_timun_produksi);
		$criteria->compare('lptc_kangkung_tanam',$this->lptc_kangkung_tanam);
		$criteria->compare('lptc_kangkung_panen',$this->lptc_kangkung_panen);
		$criteria->compare('lptc_kangkung_produksi',$this->lptc_kangkung_produksi);
		$criteria->compare('lptc_bayam_tanam',$this->lptc_bayam_tanam);
		$criteria->compare('lptc_bayam_panen',$this->lptc_bayam_panen);
		$criteria->compare('lptc_bayam_produksi',$this->lptc_bayam_produksi);
		$criteria->compare('lptc_kacangmerah_tanam',$this->lptc_kacangmerah_tanam);
		$criteria->compare('lptc_kacangmerah_panen',$this->lptc_kacangmerah_panen);
		$criteria->compare('lptc_kacangmerah_produksi',$this->lptc_kacangmerah_produksi);
		$criteria->compare('lptc_kacangpanjang_tanam',$this->lptc_kacangpanjang_tanam);
		$criteria->compare('lptc_kacangpanjang_panen',$this->lptc_kacangpanjang_panen);
		$criteria->compare('lptc_kajangpanjang_produksi',$this->lptc_kajangpanjang_produksi);
		$criteria->compare('lptc_labu_tanam',$this->lptc_labu_tanam);
		$criteria->compare('lptc_labu_panen',$this->lptc_labu_panen);
		$criteria->compare('lptc_labu_produksi',$this->lptc_labu_produksi);
		$criteria->compare('lptc_lobak_tanam',$this->lptc_lobak_tanam);
		$criteria->compare('lptc_lobak_panen',$this->lptc_lobak_panen);
		$criteria->compare('lptc_lobak_produksi',$this->lptc_lobak_produksi);
		$criteria->compare('tahun',$this->tahun);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}